{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "39eed856-88a0-4564-92b4-cf61c46a75b7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "arr1 = np.random.randint(1,10,size=(3,3))\n",
    "\n",
    "print('随机生成的二维整数数组arr1:',arr1)\n",
    "arr2 = np.random.randint(1,10,size=3)\n",
    "\n",
    "print('随机生成的一维整数数组arr2:',arr2)\n",
    "arr3 = np.random.rand(3,3)*10\n",
    "\n",
    "print('随机生成的二维小数数组arr3:',arr3)\n",
    "print('arr1和arr2相加:',np.add(arr1,arr2))\n",
    "print('arr1和arr3相乘:',np.multiply(arr1,arr3))\n",
    "print('以arr1为底数,arr2为指数的幂:',np.power(arr1,arr2,dtype='int64'))\n",
    "print('arr1的倒数:',np.reciprocal(arr1,dtype='float'))\n",
    "print('以arr3四舍五入,小数点后保留一位:',np.around(arr3,decimals=1))\n",
    "print('arr1的余弦值:',np.cos(arr1*np.pi/180))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
